  {% include "header.html" %}
  <script type="text/javascript" >
    var agency_id = "{{ agency_id }}";
    var route_type = "{{ route_type }}";
  </script>
  <h1>Stop Time  List <a href="http://code.google.com/transit/spec/transit_feed_specification.html#routes_txt___Field_Definitions">Refer</a></h1>
  {% if prompt %}
  <p id="prompt">{{ prompt }}</p>
  {% endif %}
  <div id="editor">
    <form method="POST" action="{{ url }}" id="editorform">
      <table>
        <tr>
          <th>Items</th>
          <th>Values</th>
        </tr>
        <tr>
          <td>Trip ID</td>
          <td>
          <select name = "trip_id" id = "trip_id">
          {% for trip in trips %}
             {% if trip.trip_id == stoptime.trip_id %}
             <option value="{{trip.trip_id}}" selected>{{trip.trip_id}}</option>
             {% else %}
             <option value="{{trip.trip_id}}">{{trip.trip_id}}</option>
             {% endif %}
          {% endfor %}
          </select>
          </td>
        </tr>
        <tr>
          <td>Arrival Time</td>
          <td><input name = "arrival_time" id = "arrival_time" type="TEXT" value="{{ stoptime.arrival_time }}"/>
          </td>
        </tr>
        <tr>
          <td>Departure Time</td>
          <td><input name = "departure_time" id = "departure_time" type="TEXT" value="{{ stoptime.departure_time }}"/></td>
        </tr>
        <tr>
          <td>Stop ID</td>
          <td>
          <select name = "stop_id" id = "stop_id">
          {% for stop in stops %}
             {% if stop.id == stoptime.stop_id %}
             <option value="{{stop.id}}" selected>{{stop.name}}({{stop.id}})</option>
             {% else %}
             <option value="{{stop.id}}">{{stop.name}}({{stop.id}})</option>
             {% endif %}
          {% endfor %}
          </select>
          </td>
        </tr>
        <tr>
          <td>Stop Sequence </td>
          <td><input name = "stop_sequence" id = "stop_sequence" type="TEXT" value="{{ stoptime.stop_sequence }}"/></td>
        </tr>
        <tr>
          <td> Stop Headsign </td>
          <td><input name = "stop_headsign" id = "stop_headsign" type="TEXT" value="{{ stoptime.stop_headsign }}"/></td>
        </tr>
        <tr>
          <td> Pickup Type </td>
          <td>
          <select name = "pickup_type" id = "pickup_type">
          {% for val in [0, 1, 2, 3] %}
             {% if val == stoptime.pickup_type %}
             <option value="{{val}}" selected>{{val}}</option>
             {% else %}
             <option value="{{val}}">{{val}}</option>
             {% endif %}
          {% endfor %}
          </select>
          </td>
        </tr>
        <tr>
          <td>Dropoff Type</td>
          <td>
          <select name = "drop_off_type" id = "drop_off_type">
          {% for val in [0, 1, 2, 3] %}
             {% if val == stoptime.drop_off_type %}
             <option value="{{val}}" selected>{{val}}</option>
             {% else %}
             <option value="{{val}}">{{val}}</option>
             {% endif %}
          {% endfor %}
          </select></td>
        </tr>
        <tr>
          <td> Shape Distance Traveled </td>
          <td><input name = "shape_dist_traveled" id = "shape_dist_traveled" type="TEXT" value="{{ stoptime.shape_dist_traveled }}"/></td>
        </tr>
        <tr>
          <td colspan="2">
            <input type="submit" id = "submit" value="{{ submit }}" name = "submit" />
          </td>
        </tr>
      </table>
  </form>


</div>
<div class="sort">
  <form method="POST" action="" name="search">
    <input type="text" value=""/> <input type="submit" value="Search"/>
  </form>


</div>
    <div class="pager">
      paging info: [<a href="#">1</a>] [<a href="#">2</a>] ... [<a href="#">last</a>] <input type="text" value="" size="4" maxlength="4"/> <input type="submit" value="Go" />
    </div>
    <table>
      <tr>
        <th>&nbsp;</th>
        <th>Trip ID</th>
        <th>Arrival Time</th>
        <th>Departure Time</th>
        <th>Stop ID</th>
        <th>Stop Sequence</th>
        <th>Stop Headsign</th>
        <th>Pick up Type</th>
        <th>Drop off Type</th>
        <th>Shape Distance Traveled</th>
        <th>Action</th>
      </tr>
      <!--
      <tr>
        <td><input type="checkbox" /></td>
        <td>SLOT</td>
        <td>Boston Data Center </td>
        <td>Australia/Darwin</td>
        <td>en</td>
        <td>(132) 2923-282-ABC</td>
        <td>http://www.google.com</td>
        <td><a href="#">Routes</a></td>
        <td><a href="#">Edit</a>&nbsp;<a href="#">Delete</a><a href="#"></a></td>
      </tr>
      -->
      {% for stoptime in stoptimes %}
      <tr>
        <td><input type="checkbox" name="deleteid" value="{{stoptime.trip_id}}"/></td>
        <td>{{stoptime.trip_id}}</td>
        <td>{{stoptime.arrival_time}}</td>
        <td>{{stoptime.departure_time}}</td>
        <td>{{stoptime.stop_id}}</td>
        <td>{{stoptime.stop_sequence}}</td>
        <td>{{stoptime.stop_headsign}}</td>
        <td>{{stoptime.pickup_type}}</td>
        <td>{{stoptime.drop_off_type}}</td>
        <td>{{stoptime.shape_dist_traveled}}</td>
        <!--
        <td><a href="#">Patterns</a> <a href="#">Trips</a><a href="/admin/trip?agency={{agency_id}}"></a></td>
        -->
        <td>
          <a href="/admin/stoptime?act=edit&id={{stoptime.trip_id}}&sequence={{stoptime.stop_sequence}}">Edit</a>&nbsp;
          <a href="/admin/stoptime?act=delete&id={{stoptime.trip_id}}&sequence={{stoptime.stop_sequence}}">Delete</a>
        </td>
      </tr>
      {% endfor %}
    </table>
    <div class="pager">
      [<a href="#">1</a>] [<a href="#">2</a>] ... [<a href="#">last</a>] <input type="text" value="" size="4" maxlength="4"/> <input type="submit" value="Go" />
    </div>
    <div class="control">
      <input type="submit" value="Delete All"/>
    </div>
  </body>
</html>
